package com.cmict.data.infra.service.message;

import com.baomidou.mybatisplus.extension.service.IService;
import com.cmict.data.framework.common.pojo.PageResult;
import com.cmict.data.infra.controller.admin.message.vo.AnnouncementDTO;
import com.cmict.data.infra.dal.dataobject.message.Announcement;
import com.cmict.data.infra.controller.admin.message.vo.AnnouncementQO;
import com.cmict.data.infra.controller.admin.message.vo.AnnouncementPageVO;

import java.util.List;

/**
 * 公告信息
 *
 * @author hccake 2020-12-15 17:01:15
 */
public interface AnnouncementService extends IService<Announcement> {

    /**
     * 根据QueryObject查询分页数据
     *
     * @param qo   查询参数对象
     * @return PageResult<AnnouncementVO> 分页数据
     */
    PageResult<AnnouncementPageVO> queryPage(AnnouncementQO qo);

    /**
     * 创建公告
     *
     * @param announcementDTO 公告信息
     * @return boolean
     */
    boolean addAnnouncement(AnnouncementDTO announcementDTO);

    /**
     * 更新公告信息
     *
     * @param announcementDTO announcementDTO
     * @return boolean
     */
    boolean updateAnnouncement(AnnouncementDTO announcementDTO);


    /**
     * 获取用户拉取过的发布中，且满足失效时间的公告信息
     *
     * @param userId 用户id
     * @return List<Announcement>
     */
    List<Announcement> listActiveAnnouncements(Long userId);

    /**
     * 删除公告
     * @param id
     * @return
     */
    boolean removeId(Long id);

    /**
     * 撤回公告
     * @param id
     * @return
     */
     boolean retractId(Long id);

    /**
     * 发送公共
     */
    void  sendAnnouncement(Long id);

    Announcement getAnnouncement(Long id);


}